package com.laivi.basic.model.file.reader;

import java.io.File;

/**
 * @author laivi.zhu@gmail.com
 * @date 2014-7-9
 * description:
 */
public class ExcelReader implements IExcelReader{

	private IExcelReader reader;
	
	public ExcelReader(String path){
		this(new File(path));
	}
	
	public ExcelReader(File file){
		if(file.getName().indexOf(".xls")!=-1){
			reader=new XlsReader(file);
		}else {
			reader=new XlsxReader(file);
		}
	}

	@Override
	public void setSheet(int index) {
		reader.setSheet(index);
	}

	@Override
	public String getContent(int row, int col) {
		return reader.getContent(row, col);
	}

	@Override
	public void close() {
		reader.close();
	}

	@Override
	public int getRowNum() {
		return reader.getRowNum();
	}
}
